/**
 * 
 */
package com.nari.interfaces.decipher.gprs;

import java.math.BigDecimal;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;

import org.apache.commons.lang3.time.DateUtils;

import com.nari.heatshare.model.IAssignMeterDataGather;
import com.nari.heatshare.model.ITemperaturePointDataGather;
import com.nari.interfaces.decipher.common.HeatMeterDataProtocolDecipher;
import com.nari.interfaces.decipher.common.MeasureUnitConstants;
import com.nari.interfaces.decipher.common.warn.DecipherWarnConstants;
import com.nari.interfaces.decipher.common.warn.DecipherWarnLogger;
import com.nari.interfaces.decipher.gprs.vo.DistributeFrameStateSeal;
import com.nari.interfaces.decipher.gprs.vo.UploadMeterDataSeal;
import com.nari.interfaces.model.IHeatMeterData24Gather;
import com.nari.interfaces.model.IMissionFailureLog;
import com.nari.platform.date.CalendarUtils;
import com.nari.platform.utils.NumberSystemConversion;
import com.nari.platform.utils.StringUtils;

/**
 * 帧数据封装实体
 * @author Xiaopeng
 * @date 2013-11-6
 */
public class FrameEntitySeal {
	
	/**
	 * 依据服务端广播类型编码服务端数据帧
	 * @param broadcastType 服务端广播类型
	 * @param concentratorNo 集中器号(依据广播类型决定，如第一帧为面向所有地址域广播)
	 * @param frameIndex 服务端所需的数据帧序号
	 * @return
	 * @author Xiaopeng
	 * @date 2013-11-7
	 */
	public static synchronized String encodeServerFrame(Integer broadcastType, 
			String concentratorNo, int frameIndex) throws Exception {
		//帧字符串
		StringBuffer serverFrame = new StringBuffer("");
		//帧校验和
		long frameVerifyCs = 0;
		//前导字节
		serverFrame.append(FrameEntityConstants.pre_navigate_byte);
		serverFrame.append(FrameEntityConstants.byte_separator);
		//帧起始符
		serverFrame.append(FrameEntityConstants.frame_origin_signal);
		serverFrame.append(FrameEntityConstants.byte_separator);
		frameVerifyCs += NumberSystemConversion.hexString2Decimal(FrameEntityConstants.frame_origin_signal);
		//集中器地址域
		String concentratorAdrr = "";
		if(DistributeFrameStateSeal.serverState_broadcasting.intValue() == broadcastType) { //广播
			concentratorAdrr = FrameEntityConstants.concentrator_addr_broadcast;
		} else if(DistributeFrameStateSeal.serverState_requestData.intValue() == broadcastType) { //索要数据
			concentratorAdrr = StringUtils.averageSeparate(concentratorNo, 
					FrameEntityConstants.byte_separator, 2);
		}
		serverFrame.append(concentratorAdrr);
		serverFrame.append(FrameEntityConstants.byte_separator);
		frameVerifyCs = calConcentratorRegionCs(concentratorAdrr, frameVerifyCs);
		//子地址
		serverFrame.append(FrameEntityConstants.sub_addr_broadcast);
		serverFrame.append(FrameEntityConstants.byte_separator);
		frameVerifyCs += NumberSystemConversion.hexString2Decimal(FrameEntityConstants.sub_addr_broadcast);
		//第一目标地址本域广播
		serverFrame.append(FrameEntityConstants.firstTarget_addr_broadcast);
		serverFrame.append(FrameEntityConstants.byte_separator);
		frameVerifyCs += NumberSystemConversion.hexString2Decimal(FrameEntityConstants.firstTarget_addr_broadcast);
		//第二目标地址本域广播
		serverFrame.append(FrameEntityConstants.secondTarget_addr_broadcast);
		serverFrame.append(FrameEntityConstants.byte_separator);
		frameVerifyCs += NumberSystemConversion.hexString2Decimal(FrameEntityConstants.secondTarget_addr_broadcast);
		//数据操作代码1：GPRS发出
		serverFrame.append(FrameEntityConstants.dataOperator_c1_gprsTransmit);
		serverFrame.append(FrameEntityConstants.byte_separator);
		frameVerifyCs += NumberSystemConversion.hexString2Decimal(FrameEntityConstants.dataOperator_c1_gprsTransmit);
		//数据操作代码2：功能未定
		serverFrame.append(FrameEntityConstants.dataOperator_c2_funcUndecided);
		serverFrame.append(FrameEntityConstants.byte_separator);
		frameVerifyCs += NumberSystemConversion.hexString2Decimal(FrameEntityConstants.dataOperator_c2_funcUndecided);
		//数据长度(数据域的字节数)，一个字节的十六进制数
		serverFrame.append(StringUtils.leftPad(NumberSystemConversion.decimal2HexString(1), 2));
		serverFrame.append(FrameEntityConstants.byte_separator);
		frameVerifyCs += 1;
		//数据域(数据帧序号)，一个字节的十六进制数
		serverFrame.append(StringUtils.leftPad(NumberSystemConversion.decimal2HexString(frameIndex), 2));
		serverFrame.append(FrameEntityConstants.byte_separator);
		frameVerifyCs += frameIndex;
		//校验和
		frameVerifyCs = frameVerifyCs % 256;
		serverFrame.append(StringUtils.leftPad(NumberSystemConversion.decimal2HexString(frameVerifyCs), 2));
		serverFrame.append(FrameEntityConstants.byte_separator);
		//结束符
		serverFrame.append(FrameEntityConstants.frame_finish_signal);
		return serverFrame.toString();
	}
	
	/**
	 * 计算集中器地址域校验和
	 * @param concentratorAdrr 集中器地址域，六字节的BCD编码
	 * @param frameVerifyCs
	 * @return
	 * @author Xiaopeng
	 * @throws Exception 
	 * @date 2013-11-7
	 */
	private static long calConcentratorRegionCs(String concentratorAdrr, 
			long frameVerifyCs) throws Exception {
		String[] concentratorAdrrBytes = concentratorAdrr.split(" ");
		for(String concentratorAdrrByte: concentratorAdrrBytes) {
			frameVerifyCs += NumberSystemConversion.hexString2Decimal(concentratorAdrrByte);
		}
		return frameVerifyCs;
	}
	
	/**
	 * 解码客户端上传的数据帧
	 * @param receivedFrame
	 * @return
	 * @author Xiaopeng
	 * @date 2013-11-7
	 */
	public static synchronized UploadMeterDataSeal decodeClientFrame(String receivedFrame) throws Exception {
		//构造帧解析数据
		UploadMeterDataSeal meterDataSeal = new UploadMeterDataSeal();
		//格式化数据帧
		receivedFrame = receivedFrame.replaceAll("\r\n", "").replaceAll(" ", "");
		//帧字符数累加器
		int frameCharAccumulator = FrameEntityConstants.pre_navigate_byte_hex
				+ FrameEntityConstants.frame_origin_signal_hex;
		//集中器号
		String concentratorNo = receivedFrame.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.concentrator_addr_bcd).toLowerCase();
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.concentrator_addr_bcd
				+ FrameEntityConstants.sub_addr_hex
				+ FrameEntityConstants.firstTarget_addr_hex
				+ FrameEntityConstants.secondTarget_addr_hex
				+ FrameEntityConstants.dataOperator_c1_hex
				+ FrameEntityConstants.dataOperator_c2_hex;
		//数据长度
		String dataLengthStr = receivedFrame.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_dataLength_hex);
		int dataLength = 0;
		//数据长度编码校验
		if(StringUtils.isHexChar(dataLengthStr)) {
			dataLength = NumberSystemConversion.hexString2Decimal(dataLengthStr); //字节数
		} else {
			//构造解析异常日志
			String auditLog = "无法解析的帧数据长度【"+dataLengthStr+"】";
			IMissionFailureLog logger = DecipherWarnLogger.getMissionLogInstance(DecipherWarnConstants.logger_meterType_con, 
					concentratorNo, null, auditLog, null);
			meterDataSeal.getFrameDecoderLogList().add(logger);
			//设置解析器异常级别为致命错误
			meterDataSeal.setDecipherFailureLevel(DecipherWarnConstants.warnReport_level_fatal);
			return meterDataSeal;
		}
		dataLength = dataLength * 2; //字符个数
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_dataLength_hex;
		//数据总包数
		String totalFramesStr = receivedFrame.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_totalFrames_hex);
		int totalFrames = 0;
		//数据总包数编码校验
		if(StringUtils.isHexChar(totalFramesStr)) {
			totalFrames = NumberSystemConversion.hexString2Decimal(totalFramesStr);
		} else {
			//构造解析异常日志
			String auditLog = "无法解析的帧数据总包数【"+totalFramesStr+"】";
			IMissionFailureLog logger = DecipherWarnLogger.getMissionLogInstance(DecipherWarnConstants.logger_meterType_con, 
					concentratorNo, null, auditLog, null);
			meterDataSeal.getFrameDecoderLogList().add(logger);
			//设置解析器异常级别为致命错误
			meterDataSeal.setDecipherFailureLevel(DecipherWarnConstants.warnReport_level_fatal);
			return meterDataSeal;
		}
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_totalFrames_hex;
		//当前数据包
		String currFrameIndexStr = receivedFrame.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_currFrameIndex_hex);
		int currFrameIndex = 0;
		//当前数据包编码校验
		if(StringUtils.isHexChar(currFrameIndexStr)) {
			currFrameIndex = NumberSystemConversion.hexString2Decimal(currFrameIndexStr);
		} else {
			//构造解析异常日志
			String auditLog = "无法解析的帧当前数据包【"+currFrameIndexStr+"】";
			IMissionFailureLog logger = DecipherWarnLogger.getMissionLogInstance(DecipherWarnConstants.logger_meterType_con, 
					concentratorNo, null, auditLog, null);
			meterDataSeal.getFrameDecoderLogList().add(logger);
			//设置解析器异常级别为致命错误
			meterDataSeal.setDecipherFailureLevel(DecipherWarnConstants.warnReport_level_fatal);
			return meterDataSeal;
		}
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_currFrameIndex_hex;
		//热表数据的帧解析
		String meterDataStr = receivedFrame.substring(frameCharAccumulator, 
				receivedFrame.length() - FrameEntityConstants.frameVerify_cs_hex 
				- FrameEntityConstants.frame_finish_signal_hex);
		//设置数据帧状态
		meterDataSeal.setConcentratorNo(concentratorNo);
		meterDataSeal.setCurrFrameIndex(currFrameIndex);
		meterDataSeal.setTotalFrames(totalFrames);
		//解析热表数据
		meterDataSeal = decodeMeterDataFrameSection(dataLength, meterDataStr, meterDataSeal);
		return meterDataSeal;
	}
	
	/**
	 * 解码分配表数据、热量表、温度点数据帧
	 * @param dataLength 数据帧的字符长度
	 * @param meterDataFrame 数据帧内容
	 * @return
	 * @throws Exception
	 * @author Xiaopeng
	 * @date 2013-11-7
	 */
	private static UploadMeterDataSeal decodeMeterDataFrameSection(int dataLength, String meterDataFrame, 
			UploadMeterDataSeal meterDataSeal) throws Exception {
		//热表数据的条目数
		int meterDataNum = dataLength/FrameEntityConstants.meterData_fixedLength;
		for(int index=0; index<meterDataNum; index++) {
			String meterDataStr = meterDataFrame.substring(index * FrameEntityConstants.meterData_fixedLength, 
					(index + 1) * FrameEntityConstants.meterData_fixedLength);
			//帧字符数累加器
			int frameCharAccumulator = 0;
			//热表数据标志位
			String symbolPosStr = meterDataStr.substring(frameCharAccumulator, 
					frameCharAccumulator + FrameEntityConstants.received_distinguishCode_hex);
			//日志记录
			if(!StringUtils.isHexChar(symbolPosStr)) {
				//异常审计
				String auditLog = "无法解析的热表标识位【"+symbolPosStr+"】";
				IMissionFailureLog logger = DecipherWarnLogger.getMissionLogInstance(DecipherWarnConstants.logger_meterType_con, 
						meterDataSeal.getConcentratorNo(), meterDataSeal.getRecordTime(), auditLog, null);
				meterDataSeal.getFrameDecoderLogList().add(logger);
				continue;
			}
			int meterDistinguishSymbol = NumberSystemConversion.hexString2Decimal(symbolPosStr);
			//依据标志位判断热表数据是热量表数据、分配表数据，还是温度点数据
			if(meterDistinguishSymbol <= FrameEntityConstants.received_distinguishCode_assignMeterSerial_max) {
				IAssignMeterDataGather meterData = decodeAssignMeterDataFrame(meterDataStr);
				//按照事先约定，分配表表号 = 集中器号 + 帧数据中的热表表号
				String seriousNum = meterDataSeal.getConcentratorNo() + meterData.getSeriousNum();
				meterData.setSeriousNum(seriousNum);
				meterData.setConcentratorNo(meterDataSeal.getConcentratorNo());
				meterDataSeal.getAssignMeterDatas().add(meterData);
			} else if(meterDistinguishSymbol >= FrameEntityConstants.received_distinguishCode_tempPointSerial_min
					&& meterDistinguishSymbol <= FrameEntityConstants.received_distinguishCode_tempPointSerial_max) {
				ITemperaturePointDataGather meterData = decodeTempPointDataFrame(meterDataStr);
				meterData.setConcentratorNo(meterDataSeal.getConcentratorNo());
				meterDataSeal.getTempPointDatas().add(meterData);
			} else if(meterDistinguishSymbol >= FrameEntityConstants.received_distinguishCode_heatMeter_min) { 
				IHeatMeterData24Gather meterData = decodeHeatMeterDataFrame(meterDataStr);
				meterDataSeal.getHeatMeterDatas().add(meterData);
			}
		}
		//设置抄表日期 - 取一帧数据中抄表日期的最大值
		String recordTime = null;
		if(meterDataSeal.getAssignMeterDatas().size() > 0) {
			Collections.sort(meterDataSeal.getAssignMeterDatas(), new Comparator<IAssignMeterDataGather>() {
				public int compare(IAssignMeterDataGather o1, IAssignMeterDataGather o2) {
					//抄表日期逆序排序
					return CalendarUtils.compare(o2.getRecordTime(), o1.getRecordTime());
				}
			});
			recordTime = CalendarUtils.parseDateToString(meterDataSeal.getAssignMeterDatas().get(0).getRecordTime());
		} else if(meterDataSeal.getTempPointDatas().size() > 0) {
			Collections.sort(meterDataSeal.getTempPointDatas(), new Comparator<ITemperaturePointDataGather>() {
				public int compare(ITemperaturePointDataGather o1, ITemperaturePointDataGather o2) {
					//抄表日期逆序排序
					return CalendarUtils.compare(o2.getRecordTime(), o1.getRecordTime());
				}
			});
			recordTime = CalendarUtils.parseDateToString(meterDataSeal.getTempPointDatas().get(0).getRecordTime());
		} else if(meterDataSeal.getHeatMeterDatas().size() > 0) {
			Collections.sort(meterDataSeal.getHeatMeterDatas(), new Comparator<IHeatMeterData24Gather>() {
				public int compare(IHeatMeterData24Gather o1, IHeatMeterData24Gather o2) {
					//抄表日期逆序排序
					return CalendarUtils.compare(o2.getRecordTime(), o1.getRecordTime());
				}
			});
			recordTime = CalendarUtils.parseDateToString(meterDataSeal.getHeatMeterDatas().get(0).getRecordTime());
		}
		meterDataSeal.setRecordTime(recordTime);
		return meterDataSeal;
	}
	
	/**
	 * 根据帧内容解码为分配表数据
	 * @param frameSection
	 * @return
	 * @author Xiaopeng
	 * @date 2013-11-8
	 */
	private static IAssignMeterDataGather decodeAssignMeterDataFrame(String frameSection) throws Exception {
		IAssignMeterDataGather meterData = new IAssignMeterDataGather();
		//数据是否需要修正
		boolean ifDataRevised = false;
		//帧字符数累加器
		int frameCharAccumulator = 0;
		//热表表号(三位十进制数) - 已通过热表类型标识位校验
		String seriousNumStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_am_seriousNum_hex);
		String seriousNum = StringUtils.leftPad(new Integer(NumberSystemConversion.hexString2Decimal(seriousNumStr)).toString(), 3);
		meterData.setSeriousNum(seriousNum);
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_am_seriousNum_hex;
		//前板温度
		String fontTemperatureStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_am_fontTemperature_bcd);
		double fontTemperature = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(fontTemperatureStr)) {
			fontTemperature = new Double(fontTemperatureStr);
		} else {
			fontTemperature = new Double(FrameEntityConstants.sysrevisable_am_fontTemperature_val);
			ifDataRevised = true;
		}
		meterData.setFontTemperature(fontTemperature);
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_am_fontTemperature_bcd;
		//背板温度
		String backTmperatureStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_am_backTmperature_bcd);
		double backTmperature = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(backTmperatureStr)) {
			backTmperature = new Double(backTmperatureStr);
		} else {
			backTmperature = new Double(FrameEntityConstants.sysrevisable_am_backTmperature_val);
			ifDataRevised = true;
		}
		meterData.setBackTmperature(backTmperature);
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_am_fontTemperature_bcd;
		//当前热值
		String readNumStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_am_readNum_bcd);
		double readNum = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(readNumStr)) {
			readNum = new Double(readNumStr);
		} else {
			readNum = new Double(FrameEntityConstants.sysrevisable_am_readNum_val);
			ifDataRevised = true;
		}
		meterData.setReadNum(readNum);
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_am_readNum_bcd;
		//上传时间
		String readTimeStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_am_readTime_bcd);
		Date readTime = null;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(readTimeStr)) {
			readTime = CalendarUtils.parseStringToDate(readTimeStr, "yyMMddHHmmss");
		} else {
			readTime = CalendarUtils.parseStringToDate(FrameEntityConstants.sysrevisable_am_readTime_val, "yyMMddHHmmss");
			ifDataRevised = true;
		}
		meterData.setReadTime(readTime);
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_am_readTime_bcd;
		//1月热值
		String oneHeatStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_am_oneHeat_bcd);
		double oneHeat = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(oneHeatStr)) {
			oneHeat = new Double(oneHeatStr);
		} else {
			oneHeat = new Double(FrameEntityConstants.sysrevisable_am_oneHeat_val);
			ifDataRevised = true;
		}
		meterData.setOneHeat(oneHeat);
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_am_oneHeat_bcd;
		//2月热值
		String twoHeatStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_am_twoHeat_bcd);
		double twoHeat = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(twoHeatStr)) {
			twoHeat = new Double(twoHeatStr);
		} else {
			twoHeat = new Double(FrameEntityConstants.sysrevisable_am_twoHeat_val);
			ifDataRevised = true;
		}
		meterData.setTwoHeat(twoHeat);
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_am_twoHeat_bcd;
		//3月热值
		String threeHeatStr =frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_am_threeHeat_bcd);
		double threeHeat = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(threeHeatStr)) {
			threeHeat = new Double(threeHeatStr);
		} else {
			threeHeat = new Double(FrameEntityConstants.sysrevisable_am_threeHeat_val);
			ifDataRevised = true;
		}
		meterData.setThreeHeat(threeHeat);
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_am_threeHeat_bcd;
		//4月热值
		String fourHeatStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_am_fourHeat_bcd);
		double fourHeat = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(fourHeatStr)) {
			fourHeat = new Double(fourHeatStr);
		} else {
			fourHeat = new Double(FrameEntityConstants.sysrevisable_am_fourHeat_val);
			ifDataRevised = true;
		}
		meterData.setFourHeat(fourHeat);
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_am_fourHeat_bcd;
		//5月热值
		String fiveHeatStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_am_fiveHeat_bcd);
		double fiveHeat = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(fiveHeatStr)) {
			fiveHeat = new Double(fiveHeatStr);
		} else {
			fiveHeat = new Double(FrameEntityConstants.sysrevisable_am_fiveHeat_val);
			ifDataRevised = true;
		}
		meterData.setFiveHeat(fiveHeat);
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_am_fiveHeat_bcd;
		//10月热值
		String tenHeatStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_am_tenHeat_bcd);
		double tenHeat = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(tenHeatStr)) {
			tenHeat = new Double(tenHeatStr);
		} else {
			tenHeat = new Double(FrameEntityConstants.sysrevisable_am_tenHeat_val);
			ifDataRevised = true;
		}
		meterData.setTenHeat(tenHeat);
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_am_tenHeat_bcd;
		//11月热值
		String elevenHeatStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_am_elevenHeat_bcd);
		double elevenHeat = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(elevenHeatStr)) {
			elevenHeat = new Double(elevenHeatStr);
		} else{
			elevenHeat = new Double(FrameEntityConstants.sysrevisable_am_elevenHeat_val);
			ifDataRevised = true;
		}
		meterData.setElevenHeat(elevenHeat);
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_am_elevenHeat_bcd;
		//12月热值
		String twelveHeatStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_am_twelveHeat_bcd);
		double twelveHeat = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(twelveHeatStr)) {
			twelveHeat = new Double(twelveHeatStr);
		} else {
			twelveHeat = new Double(FrameEntityConstants.sysrevisable_am_twelveHeat_val);
			ifDataRevised = true;
		}
		meterData.setTwelveHeat(twelveHeat);
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_am_twelveHeat_bcd;
		//去年热值
		String lastYearHeatStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_am_lastYearHeat_bcd);
		double lastYearHeat = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(lastYearHeatStr)) {
			lastYearHeat = new Double(lastYearHeatStr);
		} else {
			lastYearHeat = new Double(FrameEntityConstants.sysrevisable_am_lastYearHeat_val);
			ifDataRevised = true;
		}
		meterData.setLastYearHeat(lastYearHeat);
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_am_lastYearHeat_bcd;
		//抄表时间
		String recordTimeStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_am_recordTime_bcd);
		Date recordTime = null;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(recordTimeStr)) {
			recordTime = CalendarUtils.parseStringToDate(recordTimeStr, "yyMMddHHmmss");
		} else {
			recordTime = CalendarUtils.parseStringToDate(FrameEntityConstants.sysrevisable_am_recordTime_val, "yyMMddHHmmss");
			ifDataRevised = true;
		}
		meterData.setRecordTime(recordTime);
		//热表数据类型：定点上传
		meterData.setDataType(2);
		//热表数据抄收状态
		if(ifDataRevised) {
			meterData.setUploadStatus(1); //系统修正(异常抄收)
		} else {
			meterData.setUploadStatus(0); //正常抄收
		}
		return meterData;
	}
	
	/**
	 * 根据帧内容解码为热量表数据
	 * @param frameSection
	 * @return
	 * @author Xiaopeng
	 * @date 2013-11-8
	 */
	private static IHeatMeterData24Gather decodeHeatMeterDataFrame(String frameSection) throws Exception {
		IHeatMeterData24Gather meterData = new IHeatMeterData24Gather(); //热量表抄表数据
		//数据是否需要修正
		boolean ifDataRevised = false;
		//帧字符数累加器
		int frameCharAccumulator = FrameEntityConstants.received_distinguishCode_hex;
		//热量表表号
		String meterNo = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_hm_meterNo_bcd).toLowerCase();
		meterData.setMeterNo(meterNo);
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_hm_meterNo_bcd;
		//结算日热量
		String settleAccountHeatStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_hm_settleAccountHeat_bcd);
		double settleAccountHeat = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(settleAccountHeatStr)) {
			settleAccountHeat = HeatMeterDataProtocolDecipher.decodeSettleAccountHeat(settleAccountHeatStr);
		} else {
			settleAccountHeat = new Double(FrameEntityConstants.sysrevisable_hm_settleAccountHeat_val);
			ifDataRevised = true;
		}
		meterData.setSettleAccountHeat(settleAccountHeat);
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_hm_settleAccountHeat_bcd;
		//结算日热量单位
		String settleAccountHeatUnitStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_hm_settleAccountHeatUnit_code);
		Integer settleAccountHeatUnit = 2; //默认热量单位为KWh
		if(MeasureUnitConstants.frameCode_heatUnit_kWh.equals(settleAccountHeatUnitStr)) {
			settleAccountHeatUnit = 2;
		}
		if(MeasureUnitConstants.frameCode_heatUnit_MWh.equals(settleAccountHeatUnitStr)) {
			settleAccountHeatUnit = 1;
		}
		if(MeasureUnitConstants.frameCode_heatUnit_GJ.equals(settleAccountHeatUnitStr)) {
			settleAccountHeatUnit = 3;
		}
		meterData.setSettleAccountHeatUnit(settleAccountHeatUnit);
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_hm_settleAccountHeatUnit_code;
		//当前热量或累计热量
		String sumHeatStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_hm_sumHeat_bcd);
		double sumHeat = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(sumHeatStr)) {
			sumHeat = HeatMeterDataProtocolDecipher.decodeSumHeat(sumHeatStr);
		} else {
			sumHeat = new Double(FrameEntityConstants.sysrevisable_hm_sumHeat_val);
			ifDataRevised = true;
		}
		meterData.setSumHeat(sumHeat);
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_hm_sumHeat_bcd;
		//当前热量单位
		String sumHeatUnitStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_hm_sumHeatUnit_code);
		Integer sumHeatUnit = 2; //默认热量单位为KWh
		if(MeasureUnitConstants.frameCode_heatUnit_kWh.equals(sumHeatUnitStr)) {
			sumHeatUnit = 2;
		}
		if(MeasureUnitConstants.frameCode_heatUnit_MWh.equals(sumHeatUnitStr)) {
			sumHeatUnit = 1;
		}
		if(MeasureUnitConstants.frameCode_heatUnit_GJ.equals(sumHeatUnitStr)) {
			sumHeatUnit = 3;
		}
		meterData.setSumHeatUnit(sumHeatUnit);
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_hm_sumHeatUnit_code;
		//热功率
		String heatPowerStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_hm_heatPower_bcd);
		double heatPower = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(heatPowerStr)) {
			heatPower = HeatMeterDataProtocolDecipher.decodeHeatPower(heatPowerStr);
		} else {
			heatPower = new Double(FrameEntityConstants.sysrevisable_hm_heatPower_val);
			ifDataRevised = true;
		}
		meterData.setHeatPower(heatPower);
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_hm_heatPower_bcd;
		//热功率单位
		String heatPowerUnitStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_hm_heatPowerUnit_code);
		Integer heatPowerUnit = 2; //默认热量单位为KW
		if(MeasureUnitConstants.frameCode_heatPowerUnit_kW.equals(heatPowerUnitStr)) {
			heatPowerUnit = 2;
		}
		if(MeasureUnitConstants.frameCode_heatPowerUnit_MW.equals(heatPowerUnitStr)) {
			heatPowerUnit = 1;
		}
		meterData.setHeatPowerUnit(heatPowerUnit);
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_hm_heatPowerUnit_code;
		//瞬时流量
		String instantFlowStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_hm_instantFlow_bcd);
		double instantFlow = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(instantFlowStr)) {
			instantFlow = HeatMeterDataProtocolDecipher.decodeInstantFlow(instantFlowStr);
		} else {
			instantFlow = new Double(FrameEntityConstants.sysrevisable_hm_instantFlow_val);
			ifDataRevised = true;
		}
		meterData.setInstantFlow(instantFlow);
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_hm_instantFlow_bcd;
		//瞬时流量单位
		String instantFlowUnitStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_hm_instantFlowUnit_code);
		Integer instantFlowUnit = 1; //默认瞬时流量单位为m3/h
		if(MeasureUnitConstants.frameCode_flowPowerUnit_cubicMeter_per_hour.equals(instantFlowUnitStr)) {
			instantFlowUnit = 1;
		}
		if(MeasureUnitConstants.frameCode_flowPowerUnit_L_per_hour.equals(instantFlowUnitStr)) {
			instantFlowUnit = 2;
		}
		meterData.setInstantFlowUnit(instantFlowUnit);
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_hm_instantFlowUnit_code;
		//累计流量
		String sumFlowStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_hm_sumFlow_bcd);
		double sumFlow = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(sumFlowStr)) {
			sumFlow = HeatMeterDataProtocolDecipher.decodeSumFlow(sumFlowStr);
		} else {
			sumFlow = new Double(FrameEntityConstants.sysrevisable_hm_sumFlow_val);
			ifDataRevised = true;
		}
		meterData.setSumFlow(sumFlow);
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_hm_sumFlow_bcd;
		//累计流量单位
		String sumFlowUnitStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_hm_sumFlowUnit_code);
		Integer sumFlowUnit = 1; //默认累计流量单位为m3
		if(MeasureUnitConstants.frameCode_flowUnit_cubicMeter.equals(sumFlowUnitStr)) {
			sumFlowUnit = 1;
		}
		if(MeasureUnitConstants.frameCode_flowUnit_L.equals(sumFlowUnitStr)) {
			sumFlowUnit = 2;
		}
		meterData.setSumFlowUnit(sumFlowUnit);
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_hm_sumFlowUnit_code;
		//供水温度
		String supplyTemperatureStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_hm_supplyTemperature_bcd);
		double supplyTemperature = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(supplyTemperatureStr)) {
			supplyTemperature = HeatMeterDataProtocolDecipher.decodeSupplyTemperature(supplyTemperatureStr);
		} else {
			supplyTemperature = new Double(FrameEntityConstants.sysrevisable_hm_supplyTemperature_val);
			ifDataRevised = true;
		}
		meterData.setSupplyTemperature(supplyTemperature);
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_hm_supplyTemperature_bcd;
		//回水温度
		String backTemperatureStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_hm_backTemperature_bcd);
		double backTemperature = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(backTemperatureStr)) {
			backTemperature = HeatMeterDataProtocolDecipher.decodeBackTemperature(backTemperatureStr);
		} else {
			backTemperature = new Double(FrameEntityConstants.sysrevisable_hm_backTemperature_val);
			ifDataRevised = true;
		}
		meterData.setBackTemperature(backTemperature);
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_hm_backTemperature_bcd;
		//累计工作时间
		String runHoursStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_hm_runHours_bcd);
		double runHours = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(runHoursStr)) {
			runHours = HeatMeterDataProtocolDecipher.decodeRunHours(runHoursStr);
		} else {
			runHours = new Double(FrameEntityConstants.sysrevisable_hm_runHours_val);
			ifDataRevised = true;
		}
		meterData.setRunHours(runHours);
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_hm_runHours_bcd;
		//状态字，组成：精度类型编号(2位)+保留字(1位)+异常信息(1位)
		String stateMark = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_hm_stateMark_bcd);
		//数据校验修正
		if(!StringUtils.isFullNumbericChar(stateMark)) {
			stateMark = FrameEntityConstants.sysrevisable_hm_stateMark_val;
			ifDataRevised = true;
		}
		meterData.setWrongInfo(stateMark);
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_hm_stateMark_bcd;
		//抄表时间
		String recordTimeStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_hm_recordTime_bcd);
		Date recordTime = null;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(recordTimeStr)) {
			recordTime = CalendarUtils.parseStringToDate(recordTimeStr, "yyMMddHHmmss");
		} else {
			recordTime = CalendarUtils.parseStringToDate(FrameEntityConstants.sysrevisable_hm_recordTime_val, "yyMMddHHmmss");
			ifDataRevised = true;
		}
		meterData.setRecordTime(recordTime);
		//热表数据类型：定点上传
		meterData.setDataType(2);
		//热表数据抄收状态
		if(ifDataRevised) {
			meterData.setUploadStatus(1); //系统修正(异常抄收)
		} else {
			meterData.setUploadStatus(0); //正常抄收
		}
		return meterData;
	}
	
	/**
	 * 根据帧内容解码为温度点数据
	 * @param frameSection
	 * @return
	 * @throws Exception
	 * @author Xiaopeng
	 * @date 2014-3-14
	 */
	private static ITemperaturePointDataGather decodeTempPointDataFrame(String frameSection) throws Exception {
		ITemperaturePointDataGather meterData = new ITemperaturePointDataGather();
		//数据是否需要修正
		boolean ifDataRevised = false;
		//帧字符数累加器
		int frameCharAccumulator = 0;
		//热表表号(三位十进制数) - 已通过热表标识位校验
		String seriousNumStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_tp_seriousNum_hex);
		String seriousNum = new Integer(NumberSystemConversion.hexString2Decimal(seriousNumStr)).toString();
		meterData.setSeriousNum(seriousNum);
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_tp_seriousNum_hex;
		//1点温度
		String hour1ValueStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_tp_hour1Value_bcd);
		double hour1Value = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(hour1ValueStr)) {
			hour1Value = new BigDecimal(hour1ValueStr).doubleValue();
		} else {
			hour1Value = new BigDecimal(FrameEntityConstants.sysrevisable_tp_hour1Value_val).doubleValue();
			ifDataRevised = true;
		}
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_tp_hour1Value_bcd;
		//2点温度
		String hour2ValueStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_tp_hour2Value_bcd);
		double hour2Value = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(hour2ValueStr)) {
			hour2Value = new BigDecimal(hour2ValueStr).doubleValue();
		} else {
			hour2Value = new BigDecimal(FrameEntityConstants.sysrevisable_tp_hour2Value_val).doubleValue();
			ifDataRevised = true;
		}
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_tp_hour2Value_bcd;
		//3点温度
		String hour3ValueStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_tp_hour3Value_bcd);
		double hour3Value = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(hour3ValueStr)) {
			hour3Value = new BigDecimal(hour3ValueStr).doubleValue();
		} else {
			hour3Value = new BigDecimal(FrameEntityConstants.sysrevisable_tp_hour3Value_val).doubleValue();
			ifDataRevised = true;
		}
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_tp_hour3Value_bcd;
		//4点温度
		String hour4ValueStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_tp_hour4Value_bcd);
		double hour4Value = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(hour4ValueStr)) {
			hour4Value = new BigDecimal(hour4ValueStr).doubleValue();
		} else {
			hour4Value = new BigDecimal(FrameEntityConstants.sysrevisable_tp_hour4Value_val).doubleValue();
			ifDataRevised = true;
		}
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_tp_hour4Value_bcd;
		//5点温度
		String hour5ValueStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_tp_hour5Value_bcd);
		double hour5Value = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(hour5ValueStr)) {
			hour5Value = new BigDecimal(hour5ValueStr).doubleValue();
		} else {
			hour5Value = new BigDecimal(FrameEntityConstants.sysrevisable_tp_hour5Value_val).doubleValue();
			ifDataRevised = true;
		}
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_tp_hour5Value_bcd;
		//6点温度
		String hour6ValueStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_tp_hour6Value_bcd);
		double hour6Value = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(hour6ValueStr)) {
			hour6Value = new BigDecimal(hour6ValueStr).doubleValue();
		} else {
			hour6Value = new BigDecimal(FrameEntityConstants.sysrevisable_tp_hour6Value_val).doubleValue();
			ifDataRevised = true;
		}
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_tp_hour6Value_bcd;
		//7点温度
		String hour7ValueStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_tp_hour7Value_bcd);
		double hour7Value = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(hour7ValueStr)) {
			hour7Value = new BigDecimal(hour7ValueStr).doubleValue();
		} else {
			hour7Value = new BigDecimal(FrameEntityConstants.sysrevisable_tp_hour7Value_val).doubleValue();
			ifDataRevised = true;
		}
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_tp_hour7Value_bcd;
		//8点温度
		String hour8ValueStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_tp_hour8Value_bcd);
		double hour8Value = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(hour8ValueStr)) {
			hour8Value = new BigDecimal(hour8ValueStr).doubleValue();
		} else {
			hour8Value = new BigDecimal(FrameEntityConstants.sysrevisable_tp_hour8Value_val).doubleValue();
			ifDataRevised = true;
		}
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_tp_hour8Value_bcd;
		//9点温度
		String hour9ValueStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_tp_hour9Value_bcd);
		double hour9Value = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(hour9ValueStr)) {
			hour9Value = new BigDecimal(hour9ValueStr).doubleValue();
		} else {
			hour9Value = new BigDecimal(FrameEntityConstants.sysrevisable_tp_hour9Value_val).doubleValue();
			ifDataRevised = true;
		}
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_tp_hour9Value_bcd;
		//10点温度
		String hour10ValueStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_tp_hour10Value_bcd);
		double hour10Value = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(hour10ValueStr)) {
			hour10Value = new BigDecimal(hour10ValueStr).doubleValue();
		} else {
			hour10Value = new BigDecimal(FrameEntityConstants.sysrevisable_tp_hour10Value_val).doubleValue();
			ifDataRevised = true;
		}
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_tp_hour10Value_bcd;
		//11点温度
		String hour11ValueStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_tp_hour11Value_bcd);
		double hour11Value = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(hour11ValueStr)) {
			hour11Value = new BigDecimal(hour11ValueStr).doubleValue();
		} else {
			hour11Value = new BigDecimal(FrameEntityConstants.sysrevisable_tp_hour11Value_val).doubleValue();
			ifDataRevised = true;
		}
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_tp_hour11Value_bcd;
		//12点温度
		String hour12ValueStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_tp_hour12Value_bcd);
		double hour12Value = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(hour12ValueStr)) {
			hour12Value = new BigDecimal(hour12ValueStr).doubleValue();
		} else {
			hour12Value = new BigDecimal(FrameEntityConstants.sysrevisable_tp_hour12Value_val).doubleValue();
			ifDataRevised = true;
		}
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_tp_hour12Value_bcd;
		//13点温度
		String hour13ValueStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_tp_hour13Value_bcd);
		double hour13Value = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(hour13ValueStr)) {
			hour13Value = new BigDecimal(hour13ValueStr).doubleValue();
		} else {
			hour13Value = new BigDecimal(FrameEntityConstants.sysrevisable_tp_hour13Value_val).doubleValue();
			ifDataRevised = true;
		}
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_tp_hour13Value_bcd;
		//14点温度
		String hour14ValueStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_tp_hour14Value_bcd);
		double hour14Value = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(hour14ValueStr)) {
			hour14Value = new BigDecimal(hour14ValueStr).doubleValue();
		} else {
			hour14Value = new BigDecimal(FrameEntityConstants.sysrevisable_tp_hour14Value_val).doubleValue();
			ifDataRevised = true;
		}
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_tp_hour14Value_bcd;
		//15点温度
		String hour15ValueStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_tp_hour15Value_bcd);
		double hour15Value = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(hour15ValueStr)) {
			hour15Value = new BigDecimal(hour15ValueStr).doubleValue();
		} else {
			hour15Value = new BigDecimal(FrameEntityConstants.sysrevisable_tp_hour15Value_val).doubleValue();
			ifDataRevised = true;
		}
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_tp_hour15Value_bcd;
		//16点温度
		String hour16ValueStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_tp_hour16Value_bcd);
		double hour16Value = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(hour16ValueStr)) {
			hour16Value = new BigDecimal(hour16ValueStr).doubleValue();
		} else {
			hour16Value = new BigDecimal(FrameEntityConstants.sysrevisable_tp_hour16Value_val).doubleValue();
			ifDataRevised = true;
		}
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_tp_hour16Value_bcd;
		//17点温度
		String hour17ValueStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_tp_hour17Value_bcd);
		double hour17Value = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(hour17ValueStr)) {
			hour17Value = new BigDecimal(hour17ValueStr).doubleValue();
		} else {
			hour17Value = new BigDecimal(FrameEntityConstants.sysrevisable_tp_hour17Value_val).doubleValue();
			ifDataRevised = true;
		}
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_tp_hour17Value_bcd;
		//18点温度
		String hour18ValueStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_tp_hour18Value_bcd);
		double hour18Value = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(hour18ValueStr)) {
			hour18Value = new BigDecimal(hour18ValueStr).doubleValue();
		} else {
			hour18Value = new BigDecimal(FrameEntityConstants.sysrevisable_tp_hour18Value_val).doubleValue();
			ifDataRevised = true;
		}
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_tp_hour18Value_bcd;
		//19点温度
		String hour19ValueStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_tp_hour19Value_bcd);
		double hour19Value = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(hour19ValueStr)) {
			hour19Value = new BigDecimal(hour19ValueStr).doubleValue();
		} else {
			hour19Value = new BigDecimal(FrameEntityConstants.sysrevisable_tp_hour19Value_val).doubleValue();
			ifDataRevised = true;
		}
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_tp_hour19Value_bcd;
		//20点温度
		String hour20ValueStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_tp_hour20Value_bcd);
		double hour20Value = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(hour20ValueStr)) {
			hour20Value = new BigDecimal(hour20ValueStr).doubleValue();
		} else {
			hour20Value = new BigDecimal(FrameEntityConstants.sysrevisable_tp_hour20Value_val).doubleValue();
			ifDataRevised = true;
		}
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_tp_hour20Value_bcd;
		//21点温度
		String hour21ValueStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_tp_hour21Value_bcd);
		double hour21Value = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(hour21ValueStr)) {
			hour21Value = new BigDecimal(hour21ValueStr).doubleValue();
		} else {
			hour21Value = new BigDecimal(FrameEntityConstants.sysrevisable_tp_hour21Value_val).doubleValue();
			ifDataRevised = true;
		}
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_tp_hour21Value_bcd;
		//22点温度
		String hour22ValueStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_tp_hour22Value_bcd);
		double hour22Value = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(hour22ValueStr)) {
			hour22Value = new BigDecimal(hour22ValueStr).doubleValue();
		} else {
			hour22Value = new BigDecimal(FrameEntityConstants.sysrevisable_tp_hour22Value_val).doubleValue();
			ifDataRevised = true;
		}
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_tp_hour22Value_bcd;
		//23点温度
		String hour23ValueStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_tp_hour23Value_bcd);
		double hour23Value = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(hour23ValueStr)) {
			hour23Value = new BigDecimal(hour23ValueStr).doubleValue();
		} else {
			hour23Value = new BigDecimal(FrameEntityConstants.sysrevisable_tp_hour23Value_val).doubleValue();
			ifDataRevised = true;
		}
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_tp_hour23Value_bcd;
		//0点温度
		String hour0ValueStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_tp_hour0Value_bcd);
		double hour0Value = 0;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(hour0ValueStr)) {
			hour0Value = new BigDecimal(hour0ValueStr).doubleValue();
		} else {
			hour0Value = new BigDecimal(FrameEntityConstants.sysrevisable_tp_hour0Value_val).doubleValue();
			ifDataRevised = true;
		}
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_tp_hour0Value_bcd;
		//1、2点温度精度
		String hour1$2PrecisionStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_tp_hour1$2Precision_bcd);
		//数据校验修正
		if(!StringUtils.isFullNumbericChar(hour1$2PrecisionStr)) {
			hour1$2PrecisionStr = FrameEntityConstants.sysrevisable_tp_hour1$2Precision_val;
			ifDataRevised = true;
		}
		hour1Value = new BigDecimal("0.1")
				.multiply(new BigDecimal(String.valueOf(hour1$2PrecisionStr.charAt(0))))
				.add(new BigDecimal(Double.toString(hour1Value)))
				.doubleValue();
		hour2Value = new BigDecimal("0.1")
				.multiply(new BigDecimal(String.valueOf(hour1$2PrecisionStr.charAt(1))))
				.add(new BigDecimal(Double.toString(hour2Value)))
				.doubleValue();
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_tp_hour1$2Precision_bcd;
		//3、4点温度精度
		String hour3$4PrecisionStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_tp_hour3$4Precision_bcd);
		//数据校验修正
		if(!StringUtils.isFullNumbericChar(hour3$4PrecisionStr)) {
			hour3$4PrecisionStr = FrameEntityConstants.sysrevisable_tp_hour3$4Precision_val;
			ifDataRevised = true;
		}
		hour3Value = new BigDecimal("0.1")
				.multiply(new BigDecimal(String.valueOf(hour3$4PrecisionStr.charAt(0))))
				.add(new BigDecimal(Double.toString(hour3Value)))
				.doubleValue();
		hour4Value = new BigDecimal("0.1")
				.multiply(new BigDecimal(String.valueOf(hour3$4PrecisionStr.charAt(1))))
				.add(new BigDecimal(Double.toString(hour4Value)))
				.doubleValue();
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_tp_hour3$4Precision_bcd;
		//5、6点温度精度
		String hour5$6PrecisionStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_tp_hour5$6Precision_bcd);
		//数据校验修正
		if(!StringUtils.isFullNumbericChar(hour5$6PrecisionStr)) {
			hour5$6PrecisionStr = FrameEntityConstants.sysrevisable_tp_hour5$6Precision_val;
			ifDataRevised = true;
		}
		hour5Value = new BigDecimal("0.1")
				.multiply(new BigDecimal(String.valueOf(hour5$6PrecisionStr.charAt(0))))
				.add(new BigDecimal(Double.toString(hour5Value)))
				.doubleValue();
		hour6Value = new BigDecimal("0.1")
				.multiply(new BigDecimal(String.valueOf(hour5$6PrecisionStr.charAt(1))))
				.add(new BigDecimal(Double.toString(hour6Value)))
				.doubleValue();
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_tp_hour5$6Precision_bcd;
		//7、8点温度精度
		String hour7$8PrecisionStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_tp_hour7$8Precision_bcd);
		//数据校验修正
		if(!StringUtils.isFullNumbericChar(hour7$8PrecisionStr)) {
			hour7$8PrecisionStr = FrameEntityConstants.sysrevisable_tp_hour7$8Precision_val;
			ifDataRevised = true;
		}
		hour7Value = new BigDecimal("0.1")
				.multiply(new BigDecimal(String.valueOf(hour7$8PrecisionStr.charAt(0))))
				.add(new BigDecimal(Double.toString(hour7Value)))
				.doubleValue();
		hour8Value = new BigDecimal("0.1")
				.multiply(new BigDecimal(String.valueOf(hour7$8PrecisionStr.charAt(1))))
				.add(new BigDecimal(Double.toString(hour8Value)))
				.doubleValue();
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_tp_hour7$8Precision_bcd;
		//9、10点温度精度
		String hour9$10PrecisionStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_tp_hour9$10Precision_bcd);
		//数据校验修正
		if(!StringUtils.isFullNumbericChar(hour9$10PrecisionStr)) {
			hour9$10PrecisionStr = FrameEntityConstants.sysrevisable_tp_hour9$10Precision_val;
			ifDataRevised = true;
		}
		hour9Value = new BigDecimal("0.1")
				.multiply(new BigDecimal(String.valueOf(hour9$10PrecisionStr.charAt(0))))
				.add(new BigDecimal(Double.toString(hour9Value)))
				.doubleValue();
		hour10Value = new BigDecimal("0.1")
				.multiply(new BigDecimal(String.valueOf(hour9$10PrecisionStr.charAt(1))))
				.add(new BigDecimal(Double.toString(hour10Value)))
				.doubleValue();
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_tp_hour9$10Precision_bcd;
		//11、12点温度精度
		String hour11$12PrecisionStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_tp_hour11$12Precision_bcd);
		//数据校验修正
		if(!StringUtils.isFullNumbericChar(hour11$12PrecisionStr)) {
			hour11$12PrecisionStr = FrameEntityConstants.sysrevisable_tp_hour11$12Precision_val;
			ifDataRevised = true;
		}
		hour11Value = new BigDecimal("0.1")
				.multiply(new BigDecimal(String.valueOf(hour11$12PrecisionStr.charAt(0))))
				.add(new BigDecimal(Double.toString(hour11Value)))
				.doubleValue();
		hour12Value = new BigDecimal("0.1")
				.multiply(new BigDecimal(String.valueOf(hour11$12PrecisionStr.charAt(1))))
				.add(new BigDecimal(Double.toString(hour12Value)))
				.doubleValue();
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_tp_hour11$12Precision_bcd;
		//13、14点温度精度
		String hour13$14PrecisionStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_tp_hour13$14Precision_bcd);
		//数据校验修正
		if(!StringUtils.isFullNumbericChar(hour13$14PrecisionStr)) {
			hour13$14PrecisionStr = FrameEntityConstants.sysrevisable_tp_hour13$14Precision_val;
			ifDataRevised = true;
		}
		hour13Value = new BigDecimal("0.1")
				.multiply(new BigDecimal(String.valueOf(hour13$14PrecisionStr.charAt(0))))
				.add(new BigDecimal(Double.toString(hour13Value)))
				.doubleValue();
		hour14Value = new BigDecimal("0.1")
				.multiply(new BigDecimal(String.valueOf(hour13$14PrecisionStr.charAt(1))))
				.add(new BigDecimal(Double.toString(hour14Value)))
				.doubleValue();
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_tp_hour13$14Precision_bcd;
		//15、16点温度精度
		String hour15$16PrecisionStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_tp_hour15$16Precision_bcd);
		//数据校验修正
		if(!StringUtils.isFullNumbericChar(hour15$16PrecisionStr)) {
			hour15$16PrecisionStr = FrameEntityConstants.sysrevisable_tp_hour15$16Precision_val;
			ifDataRevised = true;
		}
		hour15Value = new BigDecimal("0.1")
				.multiply(new BigDecimal(String.valueOf(hour15$16PrecisionStr.charAt(0))))
				.add(new BigDecimal(Double.toString(hour15Value)))
				.doubleValue();
		hour16Value = new BigDecimal("0.1")
				.multiply(new BigDecimal(String.valueOf(hour15$16PrecisionStr.charAt(1))))
				.add(new BigDecimal(Double.toString(hour16Value)))
				.doubleValue();
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_tp_hour15$16Precision_bcd;
		//17、18点温度精度
		String hour17$18PrecisionStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_tp_hour17$18Precision_bcd);
		//数据校验修正
		if(!StringUtils.isFullNumbericChar(hour17$18PrecisionStr)) {
			hour17$18PrecisionStr = FrameEntityConstants.sysrevisable_tp_hour17$18Precision_val;
			ifDataRevised = true;
		}
		hour17Value = new BigDecimal("0.1")
				.multiply(new BigDecimal(String.valueOf(hour17$18PrecisionStr.charAt(0))))
				.add(new BigDecimal(Double.toString(hour17Value)))
				.doubleValue();
		hour18Value = new BigDecimal("0.1")
				.multiply(new BigDecimal(String.valueOf(hour17$18PrecisionStr.charAt(1))))
				.add(new BigDecimal(Double.toString(hour18Value)))
				.doubleValue();
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_tp_hour17$18Precision_bcd;
		//19、20点温度精度
		String hour19$20PrecisionStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_tp_hour19$20Precision_bcd);
		//数据校验修正
		if(!StringUtils.isFullNumbericChar(hour19$20PrecisionStr)) {
			hour19$20PrecisionStr = FrameEntityConstants.sysrevisable_tp_hour19$20Precision_val;
			ifDataRevised = true;
		}
		hour19Value = new BigDecimal("0.1")
				.multiply(new BigDecimal(String.valueOf(hour19$20PrecisionStr.charAt(0))))
				.add(new BigDecimal(Double.toString(hour19Value)))
				.doubleValue();
		hour20Value = new BigDecimal("0.1")
				.multiply(new BigDecimal(String.valueOf(hour19$20PrecisionStr.charAt(1))))
				.add(new BigDecimal(Double.toString(hour20Value)))
				.doubleValue();
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_tp_hour19$20Precision_bcd;
		//21、22点温度精度
		String hour21$22PrecisionStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_tp_hour21$22Precision_bcd);
		//数据校验修正
		if(!StringUtils.isFullNumbericChar(hour21$22PrecisionStr)) {
			hour21$22PrecisionStr = FrameEntityConstants.sysrevisable_tp_hour21$22Precision_val;
			ifDataRevised = true;
		}
		hour21Value = new BigDecimal("0.1")
				.multiply(new BigDecimal(String.valueOf(hour21$22PrecisionStr.charAt(0))))
				.add(new BigDecimal(Double.toString(hour21Value)))
				.doubleValue();
		hour22Value = new BigDecimal("0.1")
				.multiply(new BigDecimal(String.valueOf(hour21$22PrecisionStr.charAt(1))))
				.add(new BigDecimal(Double.toString(hour22Value)))
				.doubleValue();
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_tp_hour21$22Precision_bcd;
		//23、0点温度精度
		String hour23$0PrecisionStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_tp_hour23$0Precision_bcd);
		//数据校验修正
		if(!StringUtils.isFullNumbericChar(hour23$0PrecisionStr)) {
			hour23$0PrecisionStr = FrameEntityConstants.sysrevisable_tp_hour23$0Precision_val;
			ifDataRevised = true;
		}
		hour23Value = new BigDecimal("0.1")
				.multiply(new BigDecimal(String.valueOf(hour23$0PrecisionStr.charAt(0))))
				.add(new BigDecimal(Double.toString(hour23Value)))
				.doubleValue();
		hour0Value = new BigDecimal("0.1")
				.multiply(new BigDecimal(String.valueOf(hour23$0PrecisionStr.charAt(1))))
				.add(new BigDecimal(Double.toString(hour0Value)))
				.doubleValue();
		//累加帧字符数
		frameCharAccumulator += FrameEntityConstants.received_tp_hour23$0Precision_bcd;
		//累加帧字符数 - 保留字
		frameCharAccumulator += FrameEntityConstants.received_tp_reservedInfo_bcd;
		//抄表时间
		String recordTimeStr = frameSection.substring(frameCharAccumulator, 
				frameCharAccumulator + FrameEntityConstants.received_tp_recordTime_bcd);
		Date recordTime = null;
		//数据校验修正
		if(StringUtils.isFullNumbericChar(recordTimeStr)) {
			recordTime = CalendarUtils.parseStringToDate(recordTimeStr, "yyMMddHHmmss");
		} else {
			recordTime = CalendarUtils.parseStringToDate(FrameEntityConstants.sysrevisable_tp_recordTime_val, "yyMMddHHmmss");
			ifDataRevised = true;
		}
		meterData.setRecordTime(recordTime);
		//根据系统抄表时间设置整点抄表的温度点数据
		int currentHour = CalendarUtils.get24HourFromCal(recordTime);
		switch(currentHour) {
		case 0:
			meterData.setHour0Value(hour0Value);
			break;
		case 1: 
			meterData.setHour0Value(hour0Value);
			meterData.setHour1Value(hour1Value);
			break;
		case 2:
			meterData.setHour0Value(hour0Value);
			meterData.setHour1Value(hour1Value);
			meterData.setHour2Value(hour2Value);
			break;
		case 3:
			meterData.setHour0Value(hour0Value);
			meterData.setHour1Value(hour1Value);
			meterData.setHour2Value(hour2Value);
			meterData.setHour3Value(hour3Value);
			break;
		case 4:
			meterData.setHour0Value(hour0Value);
			meterData.setHour1Value(hour1Value);
			meterData.setHour2Value(hour2Value);
			meterData.setHour3Value(hour3Value);
			meterData.setHour4Value(hour4Value);
			break;
		case 5:
			meterData.setHour0Value(hour0Value);
			meterData.setHour1Value(hour1Value);
			meterData.setHour2Value(hour2Value);
			meterData.setHour3Value(hour3Value);
			meterData.setHour4Value(hour4Value);
			meterData.setHour5Value(hour5Value);
			break;
		case 6:
			meterData.setHour0Value(hour0Value);
			meterData.setHour1Value(hour1Value);
			meterData.setHour2Value(hour2Value);
			meterData.setHour3Value(hour3Value);
			meterData.setHour4Value(hour4Value);
			meterData.setHour5Value(hour5Value);
			meterData.setHour6Value(hour6Value);
			break;
		case 7:
			meterData.setHour0Value(hour0Value);
			meterData.setHour1Value(hour1Value);
			meterData.setHour2Value(hour2Value);
			meterData.setHour3Value(hour3Value);
			meterData.setHour4Value(hour4Value);
			meterData.setHour5Value(hour5Value);
			meterData.setHour6Value(hour6Value);
			meterData.setHour7Value(hour7Value);
			break;
		case 8:
			meterData.setHour0Value(hour0Value);
			meterData.setHour1Value(hour1Value);
			meterData.setHour2Value(hour2Value);
			meterData.setHour3Value(hour3Value);
			meterData.setHour4Value(hour4Value);
			meterData.setHour5Value(hour5Value);
			meterData.setHour6Value(hour6Value);
			meterData.setHour7Value(hour7Value);
			meterData.setHour8Value(hour8Value);
			break;
		case 9:
			meterData.setHour0Value(hour0Value);
			meterData.setHour1Value(hour1Value);
			meterData.setHour2Value(hour2Value);
			meterData.setHour3Value(hour3Value);
			meterData.setHour4Value(hour4Value);
			meterData.setHour5Value(hour5Value);
			meterData.setHour6Value(hour6Value);
			meterData.setHour7Value(hour7Value);
			meterData.setHour8Value(hour8Value);
			meterData.setHour9Value(hour9Value);
			break;
		case 10:
			meterData.setHour0Value(hour0Value);
			meterData.setHour1Value(hour1Value);
			meterData.setHour2Value(hour2Value);
			meterData.setHour3Value(hour3Value);
			meterData.setHour4Value(hour4Value);
			meterData.setHour5Value(hour5Value);
			meterData.setHour6Value(hour6Value);
			meterData.setHour7Value(hour7Value);
			meterData.setHour8Value(hour8Value);
			meterData.setHour9Value(hour9Value);
			meterData.setHour10Value(hour10Value);
			break;
		case 11:
			meterData.setHour0Value(hour0Value);
			meterData.setHour1Value(hour1Value);
			meterData.setHour2Value(hour2Value);
			meterData.setHour3Value(hour3Value);
			meterData.setHour4Value(hour4Value);
			meterData.setHour5Value(hour5Value);
			meterData.setHour6Value(hour6Value);
			meterData.setHour7Value(hour7Value);
			meterData.setHour8Value(hour8Value);
			meterData.setHour9Value(hour9Value);
			meterData.setHour10Value(hour10Value);
			meterData.setHour11Value(hour11Value);
			break;
		case 12:
			meterData.setHour0Value(hour0Value);
			meterData.setHour1Value(hour1Value);
			meterData.setHour2Value(hour2Value);
			meterData.setHour3Value(hour3Value);
			meterData.setHour4Value(hour4Value);
			meterData.setHour5Value(hour5Value);
			meterData.setHour6Value(hour6Value);
			meterData.setHour7Value(hour7Value);
			meterData.setHour8Value(hour8Value);
			meterData.setHour9Value(hour9Value);
			meterData.setHour10Value(hour10Value);
			meterData.setHour11Value(hour11Value);
			meterData.setHour12Value(hour12Value);
			break;
		case 13:
			meterData.setHour0Value(hour0Value);
			meterData.setHour1Value(hour1Value);
			meterData.setHour2Value(hour2Value);
			meterData.setHour3Value(hour3Value);
			meterData.setHour4Value(hour4Value);
			meterData.setHour5Value(hour5Value);
			meterData.setHour6Value(hour6Value);
			meterData.setHour7Value(hour7Value);
			meterData.setHour8Value(hour8Value);
			meterData.setHour9Value(hour9Value);
			meterData.setHour10Value(hour10Value);
			meterData.setHour11Value(hour11Value);
			meterData.setHour12Value(hour12Value);
			meterData.setHour13Value(hour13Value);
			break;
		case 14:
			meterData.setHour0Value(hour0Value);
			meterData.setHour1Value(hour1Value);
			meterData.setHour2Value(hour2Value);
			meterData.setHour3Value(hour3Value);
			meterData.setHour4Value(hour4Value);
			meterData.setHour5Value(hour5Value);
			meterData.setHour6Value(hour6Value);
			meterData.setHour7Value(hour7Value);
			meterData.setHour8Value(hour8Value);
			meterData.setHour9Value(hour9Value);
			meterData.setHour10Value(hour10Value);
			meterData.setHour11Value(hour11Value);
			meterData.setHour12Value(hour12Value);
			meterData.setHour13Value(hour13Value);
			meterData.setHour14Value(hour14Value);
			break;
		case 15:
			meterData.setHour0Value(hour0Value);
			meterData.setHour1Value(hour1Value);
			meterData.setHour2Value(hour2Value);
			meterData.setHour3Value(hour3Value);
			meterData.setHour4Value(hour4Value);
			meterData.setHour5Value(hour5Value);
			meterData.setHour6Value(hour6Value);
			meterData.setHour7Value(hour7Value);
			meterData.setHour8Value(hour8Value);
			meterData.setHour9Value(hour9Value);
			meterData.setHour10Value(hour10Value);
			meterData.setHour11Value(hour11Value);
			meterData.setHour12Value(hour12Value);
			meterData.setHour13Value(hour13Value);
			meterData.setHour14Value(hour14Value);
			meterData.setHour15Value(hour15Value);
			break;
		case 16:
			meterData.setHour0Value(hour0Value);
			meterData.setHour1Value(hour1Value);
			meterData.setHour2Value(hour2Value);
			meterData.setHour3Value(hour3Value);
			meterData.setHour4Value(hour4Value);
			meterData.setHour5Value(hour5Value);
			meterData.setHour6Value(hour6Value);
			meterData.setHour7Value(hour7Value);
			meterData.setHour8Value(hour8Value);
			meterData.setHour9Value(hour9Value);
			meterData.setHour10Value(hour10Value);
			meterData.setHour11Value(hour11Value);
			meterData.setHour12Value(hour12Value);
			meterData.setHour13Value(hour13Value);
			meterData.setHour14Value(hour14Value);
			meterData.setHour15Value(hour15Value);
			meterData.setHour16Value(hour16Value);
			break;
		case 17:
			meterData.setHour0Value(hour0Value);
			meterData.setHour1Value(hour1Value);
			meterData.setHour2Value(hour2Value);
			meterData.setHour3Value(hour3Value);
			meterData.setHour4Value(hour4Value);
			meterData.setHour5Value(hour5Value);
			meterData.setHour6Value(hour6Value);
			meterData.setHour7Value(hour7Value);
			meterData.setHour8Value(hour8Value);
			meterData.setHour9Value(hour9Value);
			meterData.setHour10Value(hour10Value);
			meterData.setHour11Value(hour11Value);
			meterData.setHour12Value(hour12Value);
			meterData.setHour13Value(hour13Value);
			meterData.setHour14Value(hour14Value);
			meterData.setHour15Value(hour15Value);
			meterData.setHour16Value(hour16Value);
			meterData.setHour17Value(hour17Value);
			break;
		case 18:
			meterData.setHour0Value(hour0Value);
			meterData.setHour1Value(hour1Value);
			meterData.setHour2Value(hour2Value);
			meterData.setHour3Value(hour3Value);
			meterData.setHour4Value(hour4Value);
			meterData.setHour5Value(hour5Value);
			meterData.setHour6Value(hour6Value);
			meterData.setHour7Value(hour7Value);
			meterData.setHour8Value(hour8Value);
			meterData.setHour9Value(hour9Value);
			meterData.setHour10Value(hour10Value);
			meterData.setHour11Value(hour11Value);
			meterData.setHour12Value(hour12Value);
			meterData.setHour13Value(hour13Value);
			meterData.setHour14Value(hour14Value);
			meterData.setHour15Value(hour15Value);
			meterData.setHour16Value(hour16Value);
			meterData.setHour17Value(hour17Value);
			meterData.setHour18Value(hour18Value);
			break;
		case 19:
			meterData.setHour0Value(hour0Value);
			meterData.setHour1Value(hour1Value);
			meterData.setHour2Value(hour2Value);
			meterData.setHour3Value(hour3Value);
			meterData.setHour4Value(hour4Value);
			meterData.setHour5Value(hour5Value);
			meterData.setHour6Value(hour6Value);
			meterData.setHour7Value(hour7Value);
			meterData.setHour8Value(hour8Value);
			meterData.setHour9Value(hour9Value);
			meterData.setHour10Value(hour10Value);
			meterData.setHour11Value(hour11Value);
			meterData.setHour12Value(hour12Value);
			meterData.setHour13Value(hour13Value);
			meterData.setHour14Value(hour14Value);
			meterData.setHour15Value(hour15Value);
			meterData.setHour16Value(hour16Value);
			meterData.setHour17Value(hour17Value);
			meterData.setHour18Value(hour18Value);
			meterData.setHour19Value(hour19Value);
			break;
		case 20:
			meterData.setHour0Value(hour0Value);
			meterData.setHour1Value(hour1Value);
			meterData.setHour2Value(hour2Value);
			meterData.setHour3Value(hour3Value);
			meterData.setHour4Value(hour4Value);
			meterData.setHour5Value(hour5Value);
			meterData.setHour6Value(hour6Value);
			meterData.setHour7Value(hour7Value);
			meterData.setHour8Value(hour8Value);
			meterData.setHour9Value(hour9Value);
			meterData.setHour10Value(hour10Value);
			meterData.setHour11Value(hour11Value);
			meterData.setHour12Value(hour12Value);
			meterData.setHour13Value(hour13Value);
			meterData.setHour14Value(hour14Value);
			meterData.setHour15Value(hour15Value);
			meterData.setHour16Value(hour16Value);
			meterData.setHour17Value(hour17Value);
			meterData.setHour18Value(hour18Value);
			meterData.setHour19Value(hour19Value);
			meterData.setHour20Value(hour20Value);
			break;
		case 21:
			meterData.setHour0Value(hour0Value);
			meterData.setHour1Value(hour1Value);
			meterData.setHour2Value(hour2Value);
			meterData.setHour3Value(hour3Value);
			meterData.setHour4Value(hour4Value);
			meterData.setHour5Value(hour5Value);
			meterData.setHour6Value(hour6Value);
			meterData.setHour7Value(hour7Value);
			meterData.setHour8Value(hour8Value);
			meterData.setHour9Value(hour9Value);
			meterData.setHour10Value(hour10Value);
			meterData.setHour11Value(hour11Value);
			meterData.setHour12Value(hour12Value);
			meterData.setHour13Value(hour13Value);
			meterData.setHour14Value(hour14Value);
			meterData.setHour15Value(hour15Value);
			meterData.setHour16Value(hour16Value);
			meterData.setHour17Value(hour17Value);
			meterData.setHour18Value(hour18Value);
			meterData.setHour19Value(hour19Value);
			meterData.setHour20Value(hour20Value);
			meterData.setHour21Value(hour21Value);
			break;
		case 22:
			meterData.setHour0Value(hour0Value);
			meterData.setHour1Value(hour1Value);
			meterData.setHour2Value(hour2Value);
			meterData.setHour3Value(hour3Value);
			meterData.setHour4Value(hour4Value);
			meterData.setHour5Value(hour5Value);
			meterData.setHour6Value(hour6Value);
			meterData.setHour7Value(hour7Value);
			meterData.setHour8Value(hour8Value);
			meterData.setHour9Value(hour9Value);
			meterData.setHour10Value(hour10Value);
			meterData.setHour11Value(hour11Value);
			meterData.setHour12Value(hour12Value);
			meterData.setHour13Value(hour13Value);
			meterData.setHour14Value(hour14Value);
			meterData.setHour15Value(hour15Value);
			meterData.setHour16Value(hour16Value);
			meterData.setHour17Value(hour17Value);
			meterData.setHour18Value(hour18Value);
			meterData.setHour19Value(hour19Value);
			meterData.setHour20Value(hour20Value);
			meterData.setHour21Value(hour20Value);
			meterData.setHour22Value(hour22Value);
			break;
		case 23:
			meterData.setHour0Value(hour0Value);
			meterData.setHour1Value(hour1Value);
			meterData.setHour2Value(hour2Value);
			meterData.setHour3Value(hour3Value);
			meterData.setHour4Value(hour4Value);
			meterData.setHour5Value(hour5Value);
			meterData.setHour6Value(hour6Value);
			meterData.setHour7Value(hour7Value);
			meterData.setHour8Value(hour8Value);
			meterData.setHour9Value(hour9Value);
			meterData.setHour10Value(hour10Value);
			meterData.setHour11Value(hour11Value);
			meterData.setHour12Value(hour12Value);
			meterData.setHour13Value(hour13Value);
			meterData.setHour14Value(hour14Value);
			meterData.setHour15Value(hour15Value);
			meterData.setHour16Value(hour16Value);
			meterData.setHour17Value(hour17Value);
			meterData.setHour18Value(hour18Value);
			meterData.setHour19Value(hour19Value);
			meterData.setHour20Value(hour20Value);
			meterData.setHour21Value(hour20Value);
			meterData.setHour22Value(hour22Value);
			meterData.setHour23Value(hour23Value);
			break;
		default:
			break;
		}
		//热表数据类型：定点上传
		meterData.setDataType(2);
		//热表数据抄收状态
		if(ifDataRevised) {
			meterData.setUploadStatus(1); //系统修正(异常抄收)
		} else {
			meterData.setUploadStatus(0); //正常抄收
		}
		return meterData;
	}
}
